package com.webtest.filter;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/8/20 21:44
 */
public class MyHttpServletRequest extends HttpServletRequestWrapper {

    public MyHttpServletRequest(HttpServletRequest request) {
        super(request);
    }

    @Override
    public String getParameter(String name) {
        String content = super.getParameter(name);
        if (StringUtils.isNoneEmpty(content)&&content.contains(" fuck ")) {
            content = content.replace(" fuck ","****");
        }
        return content;
    }
}
